libxl: Introduce some convenience macros
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 11 Apr 2012 13:14:14 +0000 (14:14 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 11 Apr 2012 13:14:14 +0000 (14:14 +0100)
commit38dfa9fdc0fa5786613e581c636c74da2cc82ca3
tree3c76a8aded5ffab9e013a66e10d13fc605d3a82a
parent96d60b3e3e9bdd1c50389819293945622e3a81d8
libxl: Introduce some convenience macros

We introduce:
   <type> *GCNEW(<type> *var);
   <type> *GCNEW_ARRAY(<type> *var, ssize_t nmemb);
   <type> *GCREALLOC_ARRAY(<type> *var, size_t nmemb);
   char *GCSPRINTF(const char *fmt, ...);
   void LOG(<xtl_level_suffix>, const char *fmt, ...);
   void LOGE(<xtl_level_suffix>, const char *fmt, ...);
   void LOGEV(<xtl_level_suffix>, int errnoval, const char *fmt, ...);
all of which expect, in the calling context,
   libxl__gc *gc;

Most of these will find callers in subsequent patches.  The exceptions
are the orthogonally necessary LOGE and LOGEV, and GCREALLOC_ARRAY.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl_internal.h